locaList();
function locaList() {
  let uid = localStorage.getItem("uid");
  console.log(uid);
  axios
    .get(productListAPI, {
      params: { uid },
    })
    .then((res) => {
      console.log(res);
      let pobj = res.data.data;
      console.log(pobj);
      // let arr2 = pobj.slice(0, 2);
      // console.log(arr2);
      // let arr1 = pobj.slice(2);
      // console.log(arr1);
      let resArr = pobj.map(
        (obj) =>
          `
          <div class="browse_lft_wp">
          <a href="../html/product details.html?pid=${obj.pid}" class="browse_lnk1">
            <img src="${obj.pimg}" alt="" />
            <span></span>
          </a>
          <a href="../html/product details.html?pid=${obj.pid}" class="browse_lnk2">
            <img src="${obj.pimg}" alt="" />
            <span></span>
          </a>
          <a href="../html/product details.html?pid=${obj.pid}" class="browse_lnk3">
            <img src="${obj.pimg}" alt="" />
            <span></span>
          </a>
        </div>
        <div class="browse_rig_wp">
           <a href="../html/product details.html?id=${obj.pid}" class="browse_lnk4">
             <img src="${obj.pimg}" alt="" />
           </a>
           <a href="../html/product details.html?pid=${obj.pid}" class="browse_lnk5">
             <img src="${obj.pimg}" alt="" />
             <span></span>
           </a>
         </div>
        
    `
      );
      //   let resArr2 = arr2.map(
      //     (obj) =>
      //       `
      //       <div class="browse_rig_wp">
      //     <a href="../html/product details.html?id=${obj.pid}" class="browse_lnk4">
      //       <img src="${obj.pimg}" alt="" />
      //     </a>
      //     <a href="../html/product details.html?pid=${obj.pid}" class="browse_lnk5">
      //       <img src="${obj.pimg}" alt="" />
      //       <span></span>
      //     </a>
      //   </div>
      // </div>

      // `
      //   );
      let g_main = document.querySelector(".g_main");
      console.log(g_main);
      g_main.innerHTML = resArr.join("");
    });
}
